package com.studyinghome.aop;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 限流注解
 *
 * @author Leslie (panxiang_work@163.com)
 * @website https://www.studyinghome.com
 * @create 2023-04-09 15:33
 */
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface RateLimit {
    String name() default ""; //名称

    int limit() default 5; // 限制访问次数

    int timeout() default 1000; // 时间段

    boolean ipLimit() default false; //是否限制IP

    int ipCount() default 5; //IP限制次数

    int ipTimeout() default 1000; //限制IP时间
}
